Advanced Trend Panel v3.1This is a comprehensive dashboard indicator designed to give traders a multi-faceted view of the market at a single glance. It combines key indicators across multiple timeframes, calculates trend duration, and presents all information in a clean, color-coded table. This tool is perfect for confirming trade ideas, identifying trend alignment, and understanding the underlying market dynamics.
#### Key Features:
*   **All-in-One Dashboard:** A convenient on-chart table summarizes the state of multiple key indicators, saving you screen space and time.
*   **Multi-Timeframe (MTF) Forecast:** Analyzes the long-term trend on a higher timeframe (e.g., Daily) to provide context for the current chart's trend.
*   **Trend Analysis:** Uses dual sets of EMAs (long-term and short-term) to define the primary and immediate trend directions.
*   **Trend Duration:** A unique feature that calculates how long the current short-term and long-term trends have been active, helping you gauge trend maturity.
*   **Core Indicators Included:**
    *   **ADX:** Measures trend strength to differentiate between strong trends and weak or sideways markets.
    *   **RSI:** Identifies overbought and oversold conditions.
    *   **Point of Control (POC):** Shows the price level with the highest traded volume over a lookback period, acting as a key level of support/resistance.
    *   **Volume:** Compares current volume to its moving average to spot unusual activity.
*   **Customizable Alerts:** Set up alerts for trend changes (long-term or short-term), RSI crossing into overbought/oversold zones, or shifts in ADX trend strength.
#### How to Use:
1.  Apply the indicator to your chart.
2.  In the settings, configure the timeframes, indicator lengths, and display options to match your trading style.
3.  Use the table to quickly assess if the long-term trend, short-term trend, and momentum are aligned.
4.  Enable alerts to be notified of key changes in market conditions without having to watch the chart constantly.
**Disclaimer:** This script is for educational purposes only and should not be considered financial advice. All trading involves risk. Past performance is not indicative of future results. Please backtest and use this tool as part of a comprehensive trading plan with proper risk management.
Feedback is always welcome! If you find this indicator useful, please leave a like.
Cari dalam skrip untuk " TABLE"
Price Exhaustion Envelope [BackQuant]Price Exhaustion Envelope  
Visual preview of the bands: 
 What it is 
The Price Exhaustion Envelope (PEE) is a multiโfactor overextension detector wrapped inside a dynamic envelope framework. It measures how โtiredโ a move is by blending price stretch, volume surges, momentum and acceleration, plus optional RSI divergence. The result is a composite exhaustion score that drives both onโchart signals and the adaptive width of three optional envelope bands around a smoothed baseline. When the score spikes above or below your chosen threshold, the script can flag exhaustion, paint candles, tint the background and fire alerts.
 How it works under the hood 
 Exhaustion score 
Price component: distance of close from its mean in standard deviation units.
Volume component: normalized volume pressure that highlights unusual participation.
Momentum component: rate of change and acceleration of price, scaled by their own volatility.
RSI divergence (optional): bullish and bearish divergences gently push the score lower or higher.
Mode control: choose Price, Volume, Momentum or Composite. Composite averages the main pieces for a balanced view.
 Energy scale (0 to 100) 
The composite score is pushed through a logistic transform to create an โenergyโ value. High energy (above 70 to 80) signals a move that may be running hot, while very low energy (below 20 to 30) points to exhaustion on the downside.
 Envelope engine 
Baseline: EMA of price over the main lookback length.
Width: base width is standard deviation times a multiplier.
Type selector:
โข Static keeps the width fixed.
โข Dynamic expands width in proportion to the absolute exhaustion score.
โข Adaptive links width to the energy reading so bands breathe with market โheat.โ
Smoothing: a short EMA on the width reduces jitter and keeps bands pleasant to trade around.
 Band architecture 
You can toggle up to three symmetric bands on each side of the baseline. They default to 1.0, 1.6 and 2.2 multiples of the smoothed width. Soft transparent fills create a layered thermograph of extension. The outermost band often maps to true blowโoff extremes.
 Onโchart elements 
Baseline line that flips color in real time depending on where price sits.
Up to three upper and lower bands with progressive opacity.
Triangle markers at fresh exhaustion triggers.
Tiny warning glyphs at extreme upper or lower breaches.
Optional bar coloring to visually tag exhausted candles.
Background halo when energy > 80 or < 20 for instant context.
A compact info table showing State, Score, Energy, Momentum score and where price sits inside the envelope (percent).
 How to use it in trading 
 Mean reversion plays 
When price pierces the outer band and an exhaustion marker prints, look for reversal candles or lowerโtimeframe confirmation to fade the move back toward the baseline.
For conservative entries, wait for the composite score to roll back under the threshold or for energy to drop from extreme to neutral.
Set stops just beyond the extreme levels (use extreme_upper and extreme_lower as natural invalidation points). Targets can be the baseline or the opposite inner band.
 Trend continuation with smart pullbacks 
In strong trends, the first tag of Band 1 or Band 2 against the dominant direction often offers lowโrisk continuation entries. Use energy readings: if energy is low on a pullback during an uptrend, a bounce is more likely.
Combine with RSI divergence: hidden bullish divergence near a lower band in an uptrend can be a powerful confirmation.
 Breakout filtering 
A breakout that occurs while the composite score is still moderate (not exhausted) has a higher chance of followโthrough. Skip signals when energy is already above 80 and price is punching the outer band, as the move may be late.
Watch env_position (Envelope %) in the table. Breakouts near 40 to 60 percent of the envelope are โhealthy,โ while those at 95 percent are stretched.
 Scaling out and risk control 
Use exhaustion alerts to trim positions into strength or weakness.
Trail stops just outside Band 2 or Band 3 to stay in trends while letting the envelope expand in volatile phases.
 Multiโtimeframe confluence 
Run the script on a higher timeframe to locate exhaustion context, then drill down to a lower timeframe for entries.
Opposite signals across timeframes (daily exhaustion vs. 5โminute breakout) warn you to reduce size or tighten management.
 Key inputs to experiment with 
 
 Lookback Period: larger values smooth the score and envelope, ideal for swing trading. Shorter values make it reactive for scalps.
 Exhaustion Threshold: raise above 2.0 in choppy assets to cut noise, drop to 1.5 for smooth FX pairs.
 Envelope Type: Dynamic is great for crypto spikes, Adaptive shines in stocks where volume and volatility wave together.
 RSI Divergence: turn off if you prefer a pure price/volume model or if divergence floods the score in your asset.
 
 Alert set included 
 
 Fresh upper exhaustion
 Fresh lower exhaustion
 Extreme upper breach
 Extreme lower breach
 RSI bearish divergence
 RSI bullish divergence
 
Hook these to TradingView notifications so you get pinged the moment a move hits exhaustion.
 Best practices 
Always pair exhaustion signals with structure. Support and resistance, liquidity pools and session opens matter.
Avoid blindly shorting every upper signal in a roaring bull market. Let the envelope type help you filter.
Use the table to sanityโcheck: a very high score but midโrange env_position means the band may still be wide enough to absorb more movement.
Backtest threshold combinations on your instrument. Different tickers carry different volatility fingerprints.
 Final note 
Price Exhaustion Envelope is a flexible framework, not a turnkey system. It excels as a context layer that tells you when the crowd is pressing too hard or when a move still has fuel. Combine it with sound execution tactics, risk limits and market awareness. Trade safe and let the envelope breathe with the market.
Qossai Stock Info### Qossai Stock Info Indicator
This indicator provides a concise overlay of essential stock information directly on your chart, presented in a clean, organized table. Designed for quick glances, it helps traders and investors stay informed about key fundamental and volatility metrics of the currently viewed symbol.
**Key Features:**
* **Symbol/Ticker Display:** Clearly shows the ticker of the asset you are currently viewing.
* **Dynamic Market Capitalization (Market Cap):** Automatically calculates and displays the market capitalization in a readable format (Millions, Billions, or Trillions), providing instant insight into the company's size.
* **Average True Range (ATR) as Percentage:** Shows the 14-day Average True Range (a measure of volatility) as a percentage of the closing price, helping you gauge the typical price movement. The ATR period is customizable.
* **Earnings Countdown:** Keep track of upcoming events with a precise countdown displaying the number of days remaining until the next earnings announcement. This feature can be toggled on or off via the indicator's settings.
* **Clean Table Format:** All information is presented neatly in a table with a subtle black background, ensuring readability without cluttering your main chart view.
**How to Use:**
Simply add the "Qossai Stock Info" indicator to your chart. You can adjust the ATR length and toggle the earnings countdown visibility from the indicator's settings.
**Purpose:**
This tool aims to simplify access to critical stock data, empowering users to make quicker, more informed decisions by having vital information readily available on their screen.
---
WRAMA Channel (Weighted RSI ATR MA)OVERVIEW 
The WRAMA Channel (Weighted RSI ATR MA) is an advanced technical analysis tool designed to react more quickly to price movements compared to indicators using conventional moving averages. It combines the Relative Strength Index (RSI), Average True Range (ATR), and a weighted moving average, resulting in the WRAMA. This indicator forms a dynamic price channel based on a weighted average that incorporates both trend strength (via RSI) and market volatility (via ATR). It helps traders identify trends, potential reversals, and breakout signals, while offering broad customization options.
 Key Features 
 WRAMA Price Channel: 
Generates a dynamic channel around the weighted moving average (WRAMA), adapting to market volatility and momentum, similar to Bollinger Bands. Users are encouraged to adjust channel width and length according to their strategy.
The upper and lower channel bands are calculated based on a percentage deviation from the baseline line.
The channel fill color changes depending on the price's position relative to the baseline (green above, red below), with an optional gradient for better visualization.
 Weighted Moving Average (WRAMA): 
WRAMA is a custom weighted moving average (MA1), where closing prices are weighted based on RSI and ATR, allowing it to dynamically adapt to market conditions.
Baseline: The WRAMA line calculated over a user-defined period.
 WRAMA Calculation: 
RSI Weight: Based on RSI value. When RSI is in extreme zones (below the lower threshold or above the upper threshold), an extreme weight is applied. Otherwise, the weight is based on the squared RSI value divided by 100, raised to a power defined by the rsi_weight_factor.
ATR Weight: Based on the ATR-to-average-ATR ratio. If ATR exceeds a threshold (atr_threshold ร avg_atr), an extreme weight is applied. Otherwise, the weight is based on the squared ratio of ATR to average ATR, raised to the power of the atr_weight_factor.
Combined Weight: RSI and ATR weights are combined using a rsi_atr_balance parameter. Final weight = RSI weight ร balance + ATR weight ร (1 - balance).
WRAMA Calculation: The closing price is multiplied by the combined weight. The result is averaged over the ma_length period and divided by the average of the weights, forming the WRAMA line. For current WRAMA (ma_length = 1), the calculation simplifies to a single weighted price.
 Additional Moving Averages: 
For additional confirmations, the indicator supports up to five moving averages (MA1โMA5) with various types (SMA, EMA, WMA, HMA, ALMA) and customizable periods.
All additional MAs are calculated based on WRAMA or its baseline, ensuring consistency and enabling deeper analysis within a unified methodology. MA trend directions can be tracked in a built-in signal table.
 Trading Signals: 
Breakout Signals: Breakouts above/below the channel are optionally marked with triangle shapes (green for bullish, red for bearish).
MA Signals: Price position relative to MAs or their slope generates bullish/bearish signals. These are optionally visualized with default triangles (green up, red down).
A signal table in the top-right corner summarizes the status of each moving average โ bullish, bearish, or neutral.
 Customization Options 
Channel Settings:
MA Period: Length of the WRAMA baseline (default: 100).
Channel Deviation  : Percentage offset from the baseline for upper/lower bands (default: 1.5%).
RSI Settings:
RSI Period: Length of the RSI calculation (default: 14).
RSI Upper/Lower Threshold: Overbought/oversold levels (default: 70/30).
RSI Weight Factor: Influence of RSI on weighting (default: 2.0).
ATR Settings:
ATR Period: ATR calculation length (default: 14).
ATR Threshold: Volatility threshold as a multiple of average ATR (default: 1.5).
ATR Weight Factor: Influence of ATR on weighting (default: 2.0).
RSI & ATR Combined:
Extreme Weight: Weight applied in extreme RSI/ATR conditions (default: 3.0).
RSI/ATR Balance: Balance between RSI and ATR influence (default: 0.5).
Signal Settings:
Show Breakout Signals: Enable/disable breakout triangles.
Show MA Signals: Enable/disable MA-based signals.
MA Signal Source: Choose between current WRAMA or baseline.
MA Signal Analysis: Based on price position or slope.
Neutral Threshold  : Minimum distance from MA for signal neutrality (default: 0.5%).
Minimum MA Slope  : Minimum slope for trend direction signals (default: 0.01%).
Moving Averages (MA1โMA5):
Options to enable/disable, select type (SMA, EMA, WMA, HMA, ALMA), set period length, and choose color.
Style Settings:
Gradient Fill: Enable/disable gradient coloring within the channel.
Show Baseline: Enable/disable WRAMA baseline visibility.
Colors: Customize line, fill, and signal colors.
 Use Cases 
Trend Identification: The WRAMA channel highlights trend direction and potential reversal zones when price contacts the channel edges.
Breakout Signals: Channel breakouts may indicate trend shifts or momentum surges.
MA Analysis: The signal table provides a clear summary of market direction (bullish, bearish, or neutral) based on selected moving averages.
Trading Strategies: Suitable for trend-following, mean-reversion, and scalping strategies, depending on user preferences and settings.
 Notes 
The indicator offers a high degree of flexibility, making it adaptable to various trading styles, instruments, and timeframes.
It is recommended to adjust channel length and width to fit your trading strategy.
Backtesting settings on historical data is advised to optimize parameters for a specific strategy and market.
Stock Performance DashboardStock Performance Dashboard
This indicator provides a compact, color-coded table comparing the performance of the current stock to a benchmark index across multiple timeframes: 1, 5, 10, 20, 50, and 200 days.
Columns: Period, Stock %, Index %, Outperforming (โ/โ), and Difference.
Conviction Score: The last row summarizes overall outperformance as a โconvictionโ level (e.g., Super solid, Solid, Good, Ok, Needs improv., Poor).
Mini Mode: For a quick view, Mini Mode shows only the period and outperformance status.
Customizable: Supports dark/light mode, table size, position, and optional difference column.
Space Efficient: Short headers and a minimized layout make it easy to add more info or columns in future versions.
How to use:
Add the indicator to any chart. Adjust settings in the indicator panel to change the benchmark index, enable mini mode, or reposition the table.
Ideal for:
Traders who want a fast, at-a-glance summary of how a stock is performing against its benchmark across key timeframes, directly on the chart.
Shooting Star ORB๐ง  Indicator Name: "First Candle Shooting Star + ORB"
๐ Purpose
This indicator detects when the first candle of the day forms a Shooting Star pattern and then monitors for a breakout beyond its range. It visually marks the pattern and the breakout with boxes and provides real-time alerts and a status table.
๐ What It Does Step-by-Step
1. ๐
 Detects the Start of a New Trading Day
Uses ta.change(time("D")) to identify a new trading day.
When a new day starts, it checks if the very first candle of the session is a Shooting Star.
2. ๐ฏ๏ธ Identifies a Shooting Star Pattern
A candle is labeled a Shooting Star if:
It has a small body compared to the full candle range.
It has a long upper shadow at least 2ร the body.
It has a short or tiny lower shadow.
All these criteria are adjustable through inputs.
3. ๐ฆ Draws a Box for the First Candle Range
If a Shooting Star is found in the first candle of the day:
It draws a red shaded box covering the high and low of that candle.
The box visually marks the potential Opening Range.
4. ๐ฅ Detects Breakout from Shooting Star Candle
After the first candle:
If price moves above or below the range by a specified % (like 1%), it flags a breakout.
A blue shaded box is drawn at the breakout candle for visual confirmation.
5. ๐ Alerts
๐ด Shooting Star Detected: Alerts when the first candle is a shooting star.
๐ต Breakout Detected: Alerts when the price breaks out of the first candleโs range.
6. ๐ Displays Real-Time Info Table
A small table is shown on the chart:
๐ฏ๏ธ Pattern: โShooting Starโ or blank
๐ฅ Breakout: โYesโ or โNoโ
โฑ๏ธ The timeframe being analyzed (e.g., โ5โ for 5-minute)
NSE/BSE Derivative - Next Expiry Date With HolidaysNSE & BSE Expiry Tracker with Holiday Adjustments
 
This Pine Script is a TradingView indicator that helps traders monitor upcoming expiry dates for major Indian derivative contracts. It dynamically adjusts these expiry dates based on weekends and holidays, and highlights any expiry that falls on the current day.
โธป
 Key Features
 
 1. Tracks Expiry Dates for Major Contracts
 The script calculates and displays the next expiry dates for the following instruments:
	โข	NIFTY (weekly expiry every Thursday)
	โข	BANKNIFTY, FINNIFTY, MIDCPNIFTY, NIFTYNXT50 (monthly expiry on the last Thursday of the month)
	โข	SENSEX (weekly expiry every Tuesday)
	โข	BANKEX and SENSEX 50 (monthly expiry on the last Tuesday of the month)
	โข	Stocks in the F&O segment (monthly expiry on the last Thursday)
 2. Holiday Awareness
 Users can input a list of holiday dates in the format YYYY-MM-DD,YYYY-MM-DD,.... If any calculated expiry falls on one of these holidays or a weekend, the script automatically adjusts the expiry to the previous working day (Monday to Friday).
 3. Customization Options
 The user can:
	โข	Choose the position of the expiry table on the chart (e.g. top right, bottom left).
	โข	Select the font size for the expiry table.
	โข	Enable or disable the table entirely (if implemented as an input toggle).
 4. Visual Expiry Highlighting
 If today is an expiry day for any instrument, the script highlights that instrument in the display. This makes it easy to spot significant expiry days, which are often associated with increased volatility and trading volume.
โธป
 How It Works
 	โข	The script calculates the next expiry for each index using built-in date/time functions.
	โข	For weekly expiries, it finds the next occurrence of the designated weekday.
	โข	For monthly expiries, it finds the last Thursday or Tuesday of the month.
	โข	Each expiry date is passed through a check to adjust for holidays or weekends.
	โข	If today matches the adjusted expiry date, that row is visually emphasized.
โธป
 Use Case
 
This script is ideal for traders who want a quick glance at which instruments are expiring soon โ especially those managing options, futures, or expiry-based strategies.
AsturRiskPanelIndicator Summary
ATR Engine
Length & Smoothing: Choose how many bars to use (default 14) and the smoothing method (RMA/SMA/EMA/WMA).
Median ATR: Computes a rolling median of ATR over a user-defined look-back (default 14) to derive a โscalpโ target.
Scalp Target
Automatically set at ยฝ ร median ATR, snapped to the nearest tick.
Optional rounding to whole points for simplicity.
Stop Calculation
ATR Multiplier: Scales current ATR by a user input (default 1.5) to produce your stop distance in points (and ticks when appropriate).
Distortion Handling: Switches between point-only and point + tick displays based on contract specifications.
Risk & Sizing
Risk % of account per trade (default 2 %).
Calculates dollar risk per contract and optimal contract count.
Displays all metrics (scalp, stop, risk/contract, max contracts, max risk, account size) in a customizable on-chart table.
ATR-Based Stop Placement Guidelines
 
 Trade Context	ATR Multiplier	Notes
 Tight Range Entry	1.0 ร ATR	High-conviction, precise entries. Expect more shake-outs.
 Standard Trend Entry	1.5 ร ATR	Balanced for H2/L2, MTR, DT/DB entries.
 Breakouts/Microchannels	2.0 ร ATR	Wide stops through chopโBrooks-style breathing room.
 
How to Use
Select ATR Settings
Pick an ATR length (e.g. 14) and smoothing (RMA for stability).
Adjust the median length if you want a faster/slower scalp line.
Align Multiplier with Your Setup
For tight-range entries, set ATR Multiplier โ 1.0.
For standard trend trades, leave at 1.5.
For breakout/pullback setups, increase to 2.0 or more.
Customize Risk Parameters
Enter your account size and desired risk % per trade (e.g. 2 %).
The table auto-calculates how many contracts you can take.
Read the On-Chart Table
Scalp shows your intraday target.
Stop gives Brooks-style stop distance in points (and ticks).
Risk/Contract is the dollar risk per contract.
Max Contracts tells you maximum position size.
Max Risk confirms total dollar exposure.
Visual Confirmation
Place your entry, then eyeball the scalp and stop levels against chart structure (e.g. swing highs/lows).
Adjust the ATR multiplier if market context shifts (e.g. volatility spikes).
By blending this sizing panel with contextual ATR multipliers, youโll consistently give your trades the right amount of โbreathing roomโ while keeping risk in check.
MรGAS ALGO : CNA (Cognitio Analysis) [INDICATOR]Overview
The CNA (Cognitio Analysis) is a comprehensive financial analysis tool designed to evaluate the overall health and potential of a market or company based on fundamental metrics. It aggregates data across five key metric groupsโ**Growth**, **Profitability**, **Cash Flow**, **Income**, and **Valuation**โto provide a final interpretation of market conditions. The indicator dynamically adapts to the selected fiscal period (Quarter, Year, or Trailing Twelve Months) and delivers insights into dominant trends and conflicting signals.
Key Features
1. Customizable Fiscal Period:
   - Users can select between "Quarter", "Year", or "Trailing Twelve Months" (TTM) to analyze data for their desired timeframe.
2. Dynamic Table Visualization:
   - Displays raw metric values, aggregated scores, and the final interpretation in an intuitive 
     table.
   - Highlights the final interpretation with dynamic background colors (`color.teal` for bullish, 
    `color.red` for bearish, etc.).
3. Comprehensive Data Integration:
   - Pulls financial data using TradingView's `request.financial()` function for metrics like 
     revenue, earnings, margins, and valuation ratios.
4. Normalization and Scoring:
   - Normalizes data to create a consistent scoring system, ensuring accurate comparisons across 
     metrics.
How It Works
1. Metric Group Analysis
- Growth Metrics: Measures revenue growth, earnings per share (EPS) growth, and tax 
   efficiency.
- Profitability Metrics: Analyzes net profit margin, return on equity (ROE), and EBITDA margin.
- Cash Metrics: Assesses operating cash flow margin, free cash flow to operating cash flow 
  ratio, and cash flow coverage.
- Income Metrics: Examines gross profit margin, operating profit margin, and EBIT margin.
- Valuation Metrics: Evaluates price-to-earnings (P/E), price-to-sales (P/S), and enterprise 
  value-to-EBITDA (EV/EBITDA).
2. Dynamic Scoring System
- Metrics are normalized to ensure consistency across different scales.
- A geometric mean is used to calculate scores for each metric group, ensuring that all metrics 
   within a group contribute equally to the final score.
3. Dominant Trend Identification
- Scores from all five metric groups are aggregated to determine the **dominant trend** of the 
   market.
- The dominant trend is categorized as:
  - Bullish: Strong fundamentals across most metrics.
  - Bearish: Weak fundamentals across most metrics.
  - Neutral: Balanced conditions with no clear direction.
  - Unclear: Mixed signals dominate, requiring further monitoring.
4. Conflicting Signals Interpretation
- The indicator identifies scenarios where metrics conflict (e.g., high growth but low valuation).
- These conflicting signals provide nuanced insights into market conditions, highlighting rare opportunities or potential risks.
How to Use the Indicator
1. Select Fiscal Period:
   - Choose between "FQ", "FY", or "TTM" to analyze data for the desired timeframe.
2. Review Metric Scores:
   - Examine the scores for each metric group (Growth, Profitability, Cash, Income, Valuation) to 
    understand the underlying performance.
3. Interpret Final Output:
   - The final interpretation provides a summary of the dominant trend and conflicting signals, 
    helping users make informed decisions.
4. Dynamic Coloring:
   - Use the dynamic background colors in the table to quickly identify market sentiment 
    (bullish, bearish, neutral, or mixed).
Applications
- Identifying Opportunities:
  - Look for bullish dominant trends combined with undervalued growth opportunities for 
    potential long positions.
- Avoiding Risks:
  - Watch out for bearish dominant trends with overvaluation alerts to avoid potential losses.
- Monitoring Neutral Markets:
  - Use the indicator to identify neutral markets and wait for clearer signals before making 
    decisions.
Conclusion
The CNA (Cognitio Analysis) is a powerful tool for traders and investors seeking to make informed decisions based on fundamental analysis. By combining detailed metric evaluations, dynamic scoring, and sentiment-based interpretations, this indicator provides a comprehensive view of market conditions. Whether you're identifying undervalued opportunities, avoiding overvalued risks, or monitoring neutral markets, this indicator equips you with the insights needed to navigate complex financial landscapes.
Please Note:
This indicator is provided for informational and educational purposes only. It is not financial advice, and it should not be considered a recommendation to buy, sell, or trade any financial instrument. Trading involves significant risks, including the potential loss of your entire investment. Always conduct your own research and consult with a licensed financial advisor before making any trading decisions.
The results and images provided are based on algorithms and historical/paid real-time market data but do not guarantee future results or accuracy. Use this tool at your own risk, and understand that past performance is not indicative of future outc
FSH ATR MTF MonitorThe FSH ATR MTF Monitor tracks the Average True Range (ATR) and current range across six customizable timeframes, displaying the results in a table. When a timeframeโs range exceeds its ATR, the range value turns yellow, signaling heightened volatility. This multi-timeframe tool helps traders assess market conditions and plan entries or exits.
Key Features:
- Monitors ATR and range for up to six timeframes simultaneously.
- Customizable ATR length and timeframe inputs.
- Highlights ranges exceeding ATR in yellow for quick identification.
- Table display with toggle option for flexibility.
How to Use:
1. Add the indicator to your chart.
2. Adjust the ATR length and timeframes in the inputs as needed.
3. Watch for yellow range values to spot volatility spikes across timeframes.
4. Toggle the table off if not needed.
Ideal for scalpers, swing traders, or anyone analyzing volatility across multiple timeframes.
Multi-Time Frame DMI with Gradient Bar ColoringDisplays a table showing the Directional Movement Index (DMI) sentiment for multiple time frames based on the Average Directional Index (ADX) value for each time frame.
Table Position and Text Size are configurable, with two styles (vertical or horizontal) available.
Time frame labels can be toggled off for color-only table.
Bars are colored based on the ADX value using a color gradient between the bullish and bearish color inputs. The neutral color is independent of the gradient for contrast.
Nasdaq Risk Calculator - DTFXNasdaq Risk Calculator
This Pine Script (v5) indicator provides a dashboard-style tool for calculating trading risk based on manually input tick measurements for Nasdaq futures contracts (NQ and MNQ). Designed as an overlay on the main chart, it displays key risk metrics in a fixed-position table, allowing traders to assess contract type, lot size, risk ticks, and actual risk in dollars relative to a user-defined risk amount.
Features:
Manual Tick Input: Enter the number of ticks (e.g., from a ruler measurement) to define the price range for risk calculation.
Risk Calculation: Computes the optimal contract (NQ or MNQ), number of lots, risk ticks (half the input range), and actual risk in dollars, targeting the specified risk amount (default: $100).
Customizable Dashboard: Displays results in a single-cell table with a semi-transparent white background and gray border, positioned in one of four chart corners (Top Left, Top Right, Bottom Left, Bottom Right) via user selection.
Reset Option: Includes a toggle to clear the dashboard and start anew.
How to Use:
Add the indicator to your chart (best suited for NQ or MNQ futures).
In the settings, input your "Risk Amount ($)" and "Ticks" (e.g., 400 for a 100-point range on NQ).
Select the "Dashboard Corner" to position the table.
View the calculated risk details in the chosen corner.
Adjust inputs or reset as needed.
Notes:
NQ tick value is $5.00 (NQ_MULTIPLIER = 5.0), and MNQ tick value is $0.50 (MNQ_MULTIPLIER = 0.5).
Ideal for traders planning risk based on measured price ranges, such as support/resistance zones.
Market Trend Scanner [Afnan]This  Market Strength Scanner   indicator is designed to provide traders with a clear and concise overview of market trends using a single table. It helps you quickly determine which sectors and indices are strong, weak, or choppy, allowing you to make informed trading decisions with ease.
 How This Indicator Helps You: 
โ
 Identify Strong Sectors & Indices
๐นBy analyzing this table, you can instantly see which sectors and indices are performing well.
๐นFocus on stocks within strong sectors to find high-probability buying opportunities.
โ
 Avoid Weak or Choppy Markets
๐นThe indicator highlights bearish or consolidating sectors, helping you avoid poor trading conditions.
๐นStay away from sectors that are weak or moving sideways to reduce unnecessary risks.
โ
 Understand Market Sentiment in Seconds
๐นIf most sectors are bullish, the market is in an uptrendโgiving you confidence to take long positions.
๐นIf the majority are bearish, the market is weak, signaling caution.
๐นA mix of bullish and bearish sectors indicates a choppy market, warning you to avoid trading or adjust your strategy.
โ
 Powered by 4 Customizable EMAs
๐นThe indicator uses 4 Exponential Moving Averages (EMAs) to determine trends for each sector and index.
๐นThese EMAs are fully modifiable, allowing you to adjust them based on your preferred strategy.
โ
 Covers 25 Major Indices (Fully Customizable)
๐นBy default, the indicator tracks 25 key indices, giving you a broad market perspective.
๐นYou can customize the list to focus on the indices that matter most to you.
 Why Use This Indicator? 
๐น Saves Time โ No need to analyze multiple charts manually. The table gives you everything at a glance.
๐น Improves Trade Selection โ Focus only on strong sectors for better trade accuracy.
๐น Works in All Market Conditions โ Whether the market is trending or consolidating, this tool keeps you informed.
๐น Fully Customizable โ Adjust the EMAs and indices according to your trading preferences.
 With just this one powerful indicator, you get a complete market overview, helping you align your trades with the current trend effortlessly! ๐
STRX - Correlation DominationThis indicator displays the correlation among three selected assets (for example, Gold, Dollar Index, and Nasdaq) on a custom timeframe. A table positioned at the top-right corner of the chart lets you quickly see the correlation between:
Asset 1 vs Asset 2
Asset 1 vs Asset 3
Asset 2 vs Asset 3
Correlations are calculated using the Pearson correlation function (ta.correlation). If the correlation is greater than or equal to 0.4, the value appears in green (strong positive correlation). If it is less than or equal to -0.4, it appears in red (strong negative correlation). Otherwise, it is displayed in yellow (weak correlation).
Multi-asset and multi-timeframe: Compare up to three instruments at once on your chosen timeframe.
Customizable period: Use the โCorrelation Periodโ setting to adjust the correlation calculation window.
Clear table format: The results are immediately visible in an easy-to-read table.
Disclaimer: This script is provided solely for educational and informational purposes. It does not constitute a recommendation or an invitation to invest. Use it as an additional resource and always conduct thorough market analysis before opening any trading positions. Past performance does not guarantee future results.
Visual Range Position Size CalculatorVisual Range Position Size Calculator 
The "VR Position Size Calculator" helps traders determine the appropriate position size based on their risk tolerance and the current market conditions. Below is a detailed description of the script, its functionality, and how to use it effectively.
---
 Key Features 
1. Risk Calculation: The script allows users to input their desired risk in monetary terms (in the currency of the ticker). It then calculates the position sizes for both long and short trades based on this risk.
2. Dynamic High and Low Tracking: The script dynamically tracks the highest and lowest prices within the visible range of the chart, allowing for more accurate position sizing.
3. Formatted Output: The calculated values are displayed in a user-friendly table format with thousands separators for better readability.
4. Visual Indicators: Dashed lines are drawn on the chart at the high and low points of the visible range, providing a clear visual reference for traders.
5. If the risk in security price is 1% or less, the background of the cells displaying position sizes will be green for long positions and red for short positions. If the risk is between 1% and 5%, the background changes to gray, indicating that the risk may be too high for an effective trade. If the risk exceeds 5% of the price, the text also turns gray, rendering it invisible, which signifies that there is no justification for such a trade.
---
 Code Explanation 
The script identifies the start and end times of the visible range on the chart, ensuring calculations are based only on the data currently in view. It updates and stores the highest (hh) and lowest (ll) prices within this visible range. At the end of the range, dashed lines are drawn at the high and low prices, providing a visual cue for traders.
Users can input their risk amount, which is then used to calculate potential position sizes for both long and short trades based on the current price relative to the tracked high and low. The calculated risk values and position sizes are displayed in a table on the right side of the chart, with color coding to indicate whether the calculated position size meets specific criteria.
---
 Usage Instructions 
1. Add the Indicator: To use this script, copy and paste it into Pine Script editor, then add it to your chart.
2. Input Your Risk: Adjust the 'Risk in money' input to reflect your desired risk amount for trading.
3. Analyze Position Sizes: Observe the calculated position sizes for both long and short trades displayed in the table. Use this information to guide your trading decisions.
4. Visual Cues: Utilize the dashed lines on the chart to understand recent price extremes within your visible range.
 12 Month Difference - YoY ComparisonEste script foi desenvolvido para calcular e exibir a variaรงรฃo percentual do preรงo de um ativo nos รบltimos 12 meses, de forma simples e visual. Ele utiliza dados histรณricos de preรงos e apresenta o resultado diretamente no grรกfico, permitindo ao usuรกrio acompanhar a relaรงรฃo entre o valor atual e o valor de 12 meses atrรกs.
O cรกlculo รฉ baseado em um perรญodo de 12 meses, que equivale a 252 dias รบteis no mercado financeiro. O script primeiro identifica o preรงo atual do ativo e o compara com o preรงo registrado hรก exatamente 252 dias รบteis. A diferenรงa entre esses dois valores รฉ transformada em uma variaรงรฃo percentual, o que facilita a anรกlise de desempenho do ativo ao longo do perรญodo.
Alรฉm disso, o script define uma cor para destacar o resultado:
Verde, se a variaรงรฃo percentual for positiva (indicando crescimento).
Vermelho, se a variaรงรฃo for negativa (indicando queda).
O valor calculado รฉ exibido de forma prรกtica no canto inferior direito do grรกfico, como uma tabela flutuante. Essa tabela contรฉm o texto "Relaรงรฃo 12M" e o valor percentual correspondente, permitindo uma leitura rรกpida.
Embora o resultado seja calculado para todos os momentos no grรกfico, ele รฉ mostrado apenas como uma tabela no รบltimo ponto confirmado da sรฉrie histรณrica, ou seja, no momento mais recente com dados disponรญveis. Alรฉm disso, o script inclui o valor da relaรงรฃo na legenda do grรกfico, mas ele estรก oculto visualmente para evitar sobrecarregar o layout.
Esse indicador รฉ รบtil para analisar rapidamente o desempenho de um ativo ao longo de um ano, ajudando investidores e analistas a entenderem tendรชncias e mudanรงas no mercado.
This script was developed to calculate and display the percentage change in the price of an asset over the last 12 months, in a simple and visual way. It uses historical price data and displays the result directly on the chart, allowing the user to monitor the relationship between the current value and the value from 12 months ago.
The calculation is based on a 12-month period, which is equivalent to 252 business days in the financial market. The script first identifies the current price of the asset and compares it with the price recorded exactly 252 business days ago. The difference between these two values โโis transformed into a percentage change, which makes it easier to analyze the asset's performance over the period.
In addition, the script defines a color to highlight the result:
Green, if the percentage change is positive (indicating growth).
Red, if the change is negative (indicating a decline).
The calculated value is displayed conveniently in the bottom right corner of the chart, as a floating table. This table contains the text "12M Ratio" and the corresponding percentage value, allowing for quick reading.
Although the result is calculated for all points in time on the chart, it is only displayed as a table at the last confirmed point in the historical series, i.e. the most recent point in time with available data. In addition, the script includes the ratio value in the chart legend, but it is visually hidden to avoid cluttering the layout.
This indicator is useful for quickly analyzing the performance of an asset over a year, helping investors and analysts understand trends and changes in the market.
Screener MA CrossThe Screener MA Cross is an efficient tool designed to help traders quickly identify potential buy and sell signals across multiple currency pairs and timeframes. This script monitors the crossover behavior of two moving averages (MA8 and MA50) to determine possible entry points for trades.
 Key Features: 
 
 Multi-Pair Monitoring: The indicator allows users to screen popular assets, including XAUUSD, US30, GBPUSD, EURUSD, USDJPY, USDCAD, and GBPJPY. You can add or remove symbols based on your preference.
 Dual Timeframe Analysis: It tracks moving average crossovers on both 15-minute and 1-hour charts, giving users insights into short-term and medium-term trends without switching between timeframes.
 Color-Coded Signals:
 Green: Indicates a bullish "Buy" signal when the MA8 crosses above the MA50, suggesting upward momentum.
 Red: Indicates a bearish "Sell" signal when the MA8 crosses below the MA50, signaling downward momentum.
 Gray: Represents a neutral or no-cross state, indicating no clear trend.
 Clean Table Format: Displays all relevant signals directly on your chart in a structured, easy-to-read table format, allowing you to quickly scan and assess trading opportunities.
 
 How It Works:  The script uses moving averages (MA8 and MA50) to analyze crossover patterns, a common method for identifying trend changes. A crossover occurs when a shorter moving average (MA8) crosses above or below a longer moving average (MA50). By requesting data from the 15-minute and 1-hour timeframes, the Screener MA Cross provides a clear overview of the market situation across various assets, helping you decide on potential trades.
This tool is particularly useful for trend-following strategies and can be used to spot momentum shifts on smaller timeframes, making it ideal for day traders and scalpers.
 How to Use: 
 
 Add the indicator to your chart and customize the asset symbols to match your trading preferences.
 Monitor the signals on the table. Green signals indicate potential buying opportunities, while red signals suggest possible selling points.
 Use alongside other analysis: While the Screener MA Cross offers valuable insights, it's best used in combination with other indicators and analysis techniques to confirm trade setups.
Divergence Indicator Multi [TradingFinder] MACD AO RSI DIV Chart๐ต Introduction 
๐ฃ What is Divergence in Financial Markets? 
Divergence in technical analysis happens when the price of a stock moves in a direction opposite to certain indicators. This is a crucial concept in financial markets as it can signal either a trend reversal or a continuation of the current correction in the trend. Understanding divergence helps traders and analysts make more informed decisions.
  
๐ฃ Positive Regular Divergence (RD+) 
A positive regular divergence occurs at the end of a downtrend, where two price lows form. This divergence appears when the price chart shows a new low, but the indicator does not follow, signaling potential buying opportunities. 
  
Positive divergence indicates increased buying pressure and reduced selling pressure, making it a useful signal for forecasting price increases.
๐ฃ Negative Regular Divergence (RD-) 
A negative regular divergence is seen during an uptrend when two price highs form. The price chart records a new high, but the indicator does not reflect this change, suggesting that a market downturn is likely. 
This type of divergence shows strong selling pressure and weaker buying activity, which can help identify selling opportunities.
  
Both positive and negative divergences are powerful tools for identifying potential trend reversals and key support and resistance levels. For example, when an indicator trends upward while the price moves downward, this creates divergence, warning traders to reconsider their investment strategy.
๐ฃ Different Types of Divergence in Trading 
1. Regular Divergence :
    o Positive Regular Divergence (RD+)
    o Negative Regular Divergence (RD-)
2. Hidden Divergence :
    o Positive Hidden Divergence (HD+)
    o Negative Hidden Divergence (HD-)
3.Time Divergence.
 Note : This guide focuses specifically on Regular Divergence.
๐ฃ What is Regular Divergence? 
Regular Divergence, often referred to as convergence, occurs when price action and indicators show conflicting patterns, usually signaling the end of a trend. Detecting regular divergence helps traders anticipate potential trend reversals or the formation of reversal patterns.
๐ต How to Use 
To optimize the detection of divergence, you can adjust the Fractal Period to specify the length of time for identifying divergence patterns.
Additionally, with the Divergence Detection Method, you can select oscillators like the MACD, RSI, or AO to base divergence detection on.
 Divergence in MACD :
MACD divergence occurs when the price chart forms an opposite pattern compared to the MACD line, indicating a potential price reversal.
  
 Divergence in RSI :
In a downtrend, if the price chart forms two consecutive lows with the second lower than the first, but the RSI shows two lows with the second higher, this indicates positive regular divergence, which is a buy signal.
On the other hand, during an uptrend, if the price forms two highs with the second higher than the first, but the RSI shows the second high lower, this points to negative regular divergence, indicating a sell signal.
  
 Divergence in AO (Awesome Oscillator) :
The AO indicator calculates histograms using the difference between 5-period and 34-period simple moving averages. It compares peaks and troughs of these histograms with price movements, detecting divergence and plotting lines and arrows to signal divergence.
  
๐ต Table 
The following table breaks down the main features of the oscillator. It covers four critical categories: Exist, Consecutive, Divergence Quality, and Change Phase Indicator.
 Exist : If divergence is detected, a "+" will appear in this row.
Consecutive: Shows the number of consecutive divergences that have formed in a short period.
 Divergence Quality : Evaluates the quality of the divergence based on the number of occurrences. One is labeled "Normal," two are "Good," and three or more are considered "Strong."
 Change Phase Indicator : If a phase change is detected between two oscillation peaks, this is marked in the table.
Advanced BB Bands with PlotThis code  implements an advanced version of Bollinger Bands with additional moving averages, ATR-based bands, step lines, market direction indicators, and real-time data display. Hereโs a breakdown of the functionality:
 1. Inputs and Parameters: 
length: The base period used for calculating the moving averages and the typical price.
atr_length: The length used for calculating the Average True Range (ATR).
step_length: The period for calculating step lines (highest high and lowest low over a given period).
 2. Core Calculations: 
Typical Price: (high + low + close) / 3 is the base for the moving averages.
ATR: ta.atr(atr_length) is used to create dynamic bands around the moving averages.
PL Dot: An average of the typical prices from the current and past two bars. This provides a short-term trend indicator.
 3. Multiple Moving Averages (MAs): 
Three simple moving averages (ma1, ma2, ma3) are calculated using different multiples of the base length. These help indicate short-, mid-, and long-term trends.
 4. Step Lines: 
Step Up: Highest close over the step_length.
Step Down: Lowest close over the step_length. These act as short-term support and resistance levels.
 5. Outer Bands: 
Upper Band: ma1 + 2 * ATR, an upper boundary based on ATR volatility.
Lower Band: ma1 - 2 * ATR, a lower boundary. Together, these form a dynamic range around the short-term moving average.
 6. Market Direction: 
Bullish or Bearish condition is determined by comparing ma1 and ma2. If ma1 is above ma2, the market is bullish; otherwise, it's bearish. This decision is displayed on the TradingView chart using a table.
 7. Visual Elements: 
Moving Averages (ma1, ma2, ma3): Plotted in different colors (blue, purple, white) to indicate different timeframes.
PL Dot: A step line plot for the PL Dot, which helps in spotting short-term trends.
Step Lines: Step-up and step-down levels plotted in lime and red, respectively.
Outer Bands: Upper and lower ATR-based bands plotted in aqua, with a filled region between the bands for easy visualization of price volatility.
Candlestick Coloring: Green bars for bullish and red for bearish price action.
 8. Real-Time Board Display: 
A table is created in the top-right corner of the chart to display:
The current closing price.
The market direction ("Bullish" or "Bearish").
The PL Dot value. The table updates on the most recent bar (barstate.islast).
 9. Dynamic Labels: 
On the most recent bar, labels are added dynamically to the upper and lower bands and the ma1. These labels help in identifying the values of key indicators directly on the chart.
 10. Signals and Alerts: 
Bullish and Bearish Cross: Visual signals are plotted on the chart when ma1 crosses above or below ma2. These are represented as up and down triangles, providing potential buy/sell signals.
 Key Features Summarized: 
Multi-Timeframe Moving Averages: 3 MAs based on different timeframes.
Dynamic ATR Bands: ATR-based upper and lower boundaries for volatility measurement.
Step Lines: Short-term high and low lines for support/resistance.
PL Dot: A short-term trend identifier.
Real-Time Dashboard: Live updates of price, trend, and PL Dot on the chart.
Visual Alerts: Dynamic labeling and crossover signals to assist in decision-making.
This script is designed for traders who want to track price movement within bands, evaluate trends across multiple timeframes, and visualize short-term market direction with dynamic alerts.
Market Sentiment Fear and Greed [AlgoAlpha]Unleash the power of sentiment analysis with the Market Sentiment Fear and Greed Indicator! ๐๐ก This tool provides insights into market sentiment, helping you make informed trading decisions. Let's dive into its key features and how it works. ๐โจ
 Key Features  ๐ฏ
 
  ๐ง   Sentiment Analysis : Calculates market sentiment using volume and price data. ๐
  ๐
  Customizable Lookback Window : Adjust the lookback period to fine-tune sensitivity. ๐ง
  ๐จ  Bullish and Bearish Colors : Visualize trends with customizable colors. ๐ข๐ด
  ๐  Impulse Detection : Identifies bullish and bearish impulses for trend confirmation. ๐
  ๐  Normalized Sentiment Index : Offers a normalized view of market sentiment. ๐
  ๐  Alerts : Set alerts for key sentiment changes and trend impulses. ๐จ
  ๐ข๐ด  Table Visualization : Displays sentiment strength using a gradient color table. ๐๏ธ
 
 How to Use  ๐
Maximize your trading potential with this indicator by following these steps:
 
  ๐  Add the Indicator : Search for "Market Sentiment Fear and Greed  " in TradingView's Indicators & Strategies. Customize settings like the lookback window and trend breakout threshold to suit your trading strategy.
  ๐  Monitor Sentiment : Watch the sentiment gauge and plot changes to detect market sentiment shifts. Use the Normalized Sentiment Index for a more balanced view.
  ๐จ  Set Alerts : Enable alerts for sentiment flips and trend impulses to stay ahead of market movements.
 
 How It Works  โ๏ธ
The indicator calculates market sentiment by averaging the volume and closing prices over a user-defined lookback period, creating a sentiment score. It differentiates between bullish and bearish sentiment by evaluating whether the closing price is higher or lower than the opening price, summing the respective volumes. The true sentiment is determined by comparing these summed values, with a positive score indicating bullish sentiment and a negative score indicating bearish sentiment. The indicator further normalizes this sentiment score by dividing it by the EMA of the highest high minus the lowest low over double the lookback period, ensuring values are constrained between -1 and 1. Bullish and bearish impulses are identified using Hull Moving Averages (HMA) of the positive and negative sentiments, respectively. When these impulses exceed a calculated threshold based on the standard deviation of the sentiment, it indicates a significant trend change. The script also includes a gradient color table to visually represent the strength of sentiment, and customizable alerts to notify users of key sentiment changes and trend impulses.
Unlock deeper insights into market sentiment and elevate your trading strategy with the Market Sentiment Fear and Greed Indicator! ๐โจ
Prometheus Black-Scholes Option PricesThe Black-Scholes Model is an option pricing model developed my Fischer Black and Myron Scholes in 1973 at MIT. This is regarded as the most accurate pricing model and is still used today all over the world. This script is a simulated Black-Scholes model pricing model, I will get into why I say simulated.
 What is an option? 
An option is the right, but not the obligation, to buy or sell 100 shares of a certain stock, for calls or puts respective, at a certain price, on a certain date (assuming European style options, American options can be exercised early). The reason these agreements, these  contracts  exist is to provide traders with leverage. Buying 1 contract to represent 100 shares of the underlying, more often than not, at a cheaper price. That is why the price of the option, the  premium , is a small number. If an option costs $1.00 we pay $100.00 for it because 100 shares * 1 dollar per share = 100 dollars for all the shares. When a trader purchases a call on stock XYZ with a strike of $105 while XYZ stock is trading at $100, if XYZ stock moves up to $110 dollars before expiration the option has $5 of intrinsic value. You have the right to buy something at $105 when it is trading at $110. That agreement is way more valuable now, as a result the options premium would increase. That is a quick overview about how options are traded, let's get into calculating them.
 Inputs for the Black-Scholes model 
To calculate the price of an option we need to know 5 things:
Current Price of the asset
Strike Price of the option
Time Till Expiration
Risk-Free Interest rate
Volatility
The price of a European call option ๐ถ is given by:
๐ถ = ๐0 * ฮฆ(๐1) โ ๐พ * ๐^(โ๐ * ๐) * ฮฆ(๐2)
where:
๐0 is the current price of the underlying asset.
๐พ is the strike price of the option.
๐ is the risk-free interest rate.
๐ is the time to expiration.
ฮฆ is the cumulative distribution function of the standard normal distribution.
๐1 and ๐2 are calculated as:
๐1 = (ln(๐0 / ๐พ) + (๐ + (๐^2 / 2)) * ๐) / (๐ * sqrt(๐)) 
๐2= ๐1 - (๐ * sqrt(๐)) 
๐ is the volatility of the underlying asset.
โ
The price of a European put option ๐ is given by:
๐ = ๐พ * ๐^(โ๐ * ๐) * ฮฆ(โ๐2) โ ๐0 * ฮฆ(โ๐1)
where ๐1 and ๐2 are as defined above.
Key Assumptions of the Black-Scholes Model
The price of the underlying asset follows a lognormal distribution.
There are no transaction costs or taxes.
The risk-free interest rate and volatility of the underlying asset are constant.
The underlying asset does not pay dividends during the life of the option.
The markets are efficient, meaning that all known information is already reflected in the prices.
Options can only be exercised at expiration (European-style options).
 Understanding the Script 
  
Here I have arrows pointing to specific spots on the table. They point to  Historical Volatility  and  Inputted DTE .  Inputted DTE  is a value the user may input to calculate premium for options that expire in that many days.  Historical Volatility , is the value calculated by this code. 
 length = 252 // One year of trading days
hv = ta.stdev(math.log(close / close ), length) * math.sqrt(365) 
And then made daily like the Black-Scholes model needs from this step in the code.
 hv_daily = request.security(syminfo.tickerid, "1D", hv) 
The user has the option to input their own volatility to the Script. I will get into why that may be advantageous in a moment. If the user chooses to do so the Script will change which value it is using as so.
 hv_in_use = which_sig == false ? hv_daily : sig 
  
There is a lot going on in this image but bare with me, it will all make sense by the end. The column to the far left of both the green and maroon colored columns represent the strike price of the contract, if the numbers are white that means the contract is out of the money, gray means in the money. If you remember from the calculation this represents the price to buy or sell shares at, for calls or puts respective. The column second from the left shows a value for  Simulated Market Price . This is a necessary part of this script so we can show changes in implied volatility. See, when we go to our brokerages and look at options prices, sure the price was calculated by a pricing model, but that is rarely the true price of the model. Market participant sentiment affects this value as their estimates for future volatility,  Implied Volatility  changes. 
For example, if a call option is supposed to be worth $1.00 from the pricing model, however everyone is bullish on the stock and wants to buy calls, the premium may go to $1.20 from $1.00 because participants juice up the  Implied Volatility . Higher  Implied Volatility  generally means higher premium, given enough time to expiration. Buying an option at $0.80 when it should be worth $1.00 due to changes in sentiment is a big part of the Quant Trading industry.
Of course I don't have access to an actual exchange so get prices, so I modeled participant decisions by adding or subtracting a small random value on the "perfect premium" from the Black-Scholes model, and solving for implied volatility using the Newton-Raphson method.
It is like when we have  speed = distance / time  if we know  speed  and  time , we can solve for  distance . 
This is what models the changing  Implied Volatility  in the table. The other column in the table, 3rd from the left, is the Black-Scholes model price without the changes of a random number. Finally, the 4th column from the left is that  Implied Volatility  value we calculated with the modified option price. 
 More on Implied Volatility 
 Implied Volatility  represents the future expected volatility of an asset. As it is the value in the future it is not know like Historical Volatility, only projected. We provide the user with the option to enter their own  Implied Volatility  to start with for better modeling of options close to expiration. If you want to model options 1 day from expiration you will probably have to enter a higher  Implied Volatility  so that way the prices will be higher. Since the underlying is so close to expiration they are traded so much and traders manipulate their  Implied Volatility , increasing their value. Be safe while trading these!
Thank you all for clicking on my indicator and reading this description! Happy coding, Happy trading, Be safe!
Good reference: www.investopedia.com
Market Internals & InfoThis script provides various information on Market Internals and other related info. It was a part of the Daily Levels script but that script was getting very large so I decided to separate this piece of it into its own indicator. I plan on adding some additional features in the near future so stay tuned for those!
The script provides customizability to show certain market internals, tickers, and even Market Profile TPO periods. 
Here is a summary of each setting:
 NASDAQ and NYSE Breadth Ratio 
- Ratio between Up Volume and Down Volume for NASDAQ and NYSE markets. This can help inform about the type of volume flowing in and out of these exchanges.
 Advance/Decline Line (ADL) 
The ADL focuses specifically on the number of advancing and declining stocks within an index, without considering their trading volume.
Here's how the ADL works:
It tracks the daily difference between the number of stocks that are up in price (advancing) and the number of stocks that are down in price (declining) within a particular index.
The ADL is a cumulative measure, meaning each day's difference is added to the previous day's total.
If there are more advancing stocks, the ADL goes up.
If there are more declining stocks, the ADL goes down.
By analyzing the ADL, investors can get a sense of how many stocks are participating in a market move.
Here's what the ADL can tell you:
Confirmation of Trends: When the ADL moves in the same direction as the underlying index (e.g., ADL rising with a rising index), it suggests broad participation in the trend and potentially stronger momentum.
Divergence: If the ADL diverges from the index (e.g., ADL falling while the index is rising), it can be a warning sign. This suggests that fewer stocks are participating in the rally, which could indicate a weakening trend.
Keep in mind:
The ADL is a backward-looking indicator, reflecting past market activity.
It's often used in conjunction with other technical indicators for a more complete picture.
 TRIN Arms Index 
The TRIN index, also called the Arms Index or Short-Term Trading Index, is a technical analysis tool used in the stock market to gauge  market breadth and sentiment. It essentially compares the number of advancing stocks (gaining in price) to declining stocks (losing price) along with their trading volume.
Here's how to interpret the TRIN:
High TRIN (above 1.0): This indicates a weak market where declining stocks and their volume are dominating the market. It can be a sign of a potential downward trend.
Low TRIN (below 1.0): This suggests a strong market where advancing stocks and their volume are in control. It can be a sign of a potential upward trend.
TRIN around 1.0: This represents a more balanced market, where it's difficult to say which direction the market might be headed.
Important points to remember about TRIN:
It's a short-term indicator, primarily used for intraday trading decisions.
It should be used in conjunction with other technical indicators for a more comprehensive market analysis. High or low TRIN readings don't guarantee future price movements.
 VIX/VXN 
VIX and VXN are both indexes created by the Chicago Board Options Exchange (CBOE) to measure market volatility. They  differ based on the underlying index they track:
VIX (Cboe Volatility Index): This is the more well-known index and is considered the "fear gauge" of the stock market. It reflects the market's expectation of volatility in the S&P 500 index over the next 30 days.
VXN (Cboe Nasdaq Volatility Index): This is a counterpart to the VIX, but instead gauges volatility expectations for the Nasdaq 100 index over the coming 30 days. The tech-heavy Nasdaq can sometimes diverge from the broader market represented by the S&P 500, hence the need for a separate volatility measure.
Both VIX and VXN are calculated based on the implied volatilities of options contracts listed on their respective indexes. Here's a general interpretation:
High VIX/VXN: Indicates a high level of fear or uncertainty in the market, suggesting investors expect significant price fluctuations in the near future.
Low VIX/VXN: Suggests a more complacent market with lower expectations of volatility.
Important points to remember about VIX and VXN:
They are forward-looking indicators, reflecting market sentiment about future volatility, not necessarily current market conditions.
High VIX/VXN readings don't guarantee a market crash, and low readings don't guarantee smooth sailing.
These indexes are often used by investors to make decisions about portfolio allocation and hedging strategies.
 Inside/Outside Day 
This provides a quick indication of it we are still trading inside or outside of yesterdays range and will show "Inside Day" or "Outside Day" based upon todays range vs. yesterday's range.
 Custom Ticker Choices 
Ability to add up to 5 other tickers that can be tracked within the table
 Show Market Profile TPO 
This only shows on timeframes less than 30m. It will show both the current TPO period and the remaining time within that period.
 Table Customization 
Provided drop downs to change the text size and also the location of the table.
Z-Score Forecaster[SS]Hello everyone,
I just released a neat library for Forecasting stock and equities. In it, it has a couple of novel approaches to forecasting (namely, a Moving Average forecaster and a Z-Score Forecaster). These were accomplished applying basic theories on Autoregression, ARIMA modelling and Z-Score to make new approaches to forecasting.
This is one of the novel approaches, the Z-Score forecaster. 
How this function works is it identifies the current trend over the duration of the Z-Score assessment period. So, if the Z-Score is being assessed over the previous 75 candles, it will identify the trend over the previous 75 candles. It will then plot out the forecasted levels according to the trend, up to a maximum of the max Z-Score the ticker has reached within its period. At that point, it will show a likely trend reversal. 
Here is an example:
This shows that SPY may go to 475.42 before reversing, as 475.42 is the highest z-score that has been achieved in the current trend. 
When it is in an uptrend, the forecast line will be green, when in a downtrend, it will be red.
The forecasting line is accomplished through pinescript's new polyline feature. 
In addition to the line, you can also have the indicator plot out a forecast table. The Z-Score Forecast table was formatted in a similar way to ARIMA, where it makes no bias about trend, it simply plots out both ends of the spectrum. So, if an uptrend were to continue, it will list the various uptrend targets along the way, vice versa for downtrends. 
It will also display what Z-Score these targets would amount to. Here is an example:
Looking at SPY on the daily, we can see that a likely upside target would be around 484 at just over 2 Standard Deviations (Z-Score). 
Its not liklely to go higher than that because then we are getting into 3 and 4 standard deviations. 
Remember, everything generally should be within 1 and -1 standard deviations of the mean. So if we look at the table, we can see that would be between 466 and 430. 
Customization
You can customize the Z-Score length and source. You can also toggle off and on alerts. The alerts will pop up when a ticker is trading at a previous maximum or previous minimum. 
I have also added a manual feature to plot the Z-Score SMA, which is simply the SMA over the desired Z-Score lookback time. 
And that's the indicator!
If you are interested in the library, you can  access it here . 
Thanks for checking this out and leave your questions below!






















